package service

import "agentdesign/models"

// GetPromptInstructionBySlug fetches a prompt instruction if active.
func (s *ApiService) GetPromptInstructionBySlug(slug string) (models.PromptInstruction, error) {
	instruction := models.PromptInstruction{}
	err := s.db.Get(&instruction, `
		SELECT id, slug, title, description, instruction, template_text, is_active, created_at
		FROM prompt_instructions
		WHERE slug = ? AND is_active = 1
		LIMIT 1`, slug)

	return instruction, err
}
